package cn.com.Servlet.StateServlet;

import cn.com.controler.StateView.StateViewDAO;
import cn.com.entity.StateView;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet(name = "StateServlet",value = "/StateDML")
public class StateDML extends HttpServlet {

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
         doGet(request,response);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        String type = request.getParameter("type");
        StateViewDAO stateViewDAO = new StateViewDAO();
        if(type.equals("yhcx")){           //查询公告
            StateView stateView = stateViewDAO.selectallState();
            request.setAttribute("State",stateView);
            request.getRequestDispatcher("/WebContent/HTML/UserPage/user_state/SystemState.jsp").forward(request,response);
        }
    }
}
